{us/bbi/mfdeclre.i}
{us/bbi/gplabel.i} /* EXTERNAL LABEL INCLUDE */



define variable cipid                        as character   format "x(20)" no-undo.    /* GY01 */
define variable cipdesc                      as character   format "x(20)" no-undo.    /* GY01 */
define variable cipvalue                      as character   format "x(20)" no-undo.    /* GY01 */


/* GY01 CIP SCREEN FORM */ 
form
   cipid colon 25
   cipdesc  colon 25
   space(2)
with frame cip row 8 centered overlay side-labels.
 
/* SET EXTERNAL LABELS */
setFrameLabels(frame cip:handle).
/*
message "BEFORE ON ENTRY, GO ANYWHERE DO:" view-as alert-box.
*/
cipvalue = "".
cipid = "".
cipdesc = "".

ON ENTRY, GO ANYWHERE DO:

  IF FRAME-FIELD = "dr_acct"  THEN DO:
  /*
       message FRAME-FIELD FRAME-VALUE view-as alert-box.
       */
       cipvalue = FRAME-VALUE.
       cipid-loop:
       do on error undo, retry:
      
            if can-find(first code_mstr where code_domain = global_domain
                                             and code_fldname = "xxcip"
                                             and code_value begins "glcode"
                                             and code_cmmt = cipvalue  )                                           
                                             then 
               do:
               
                      update cipid with frame cip.
                      find xxcip_mstr where xxcip_mstr.xxcip_domain = global_domain 
                                        and xxcip_mstr.xxcip_cipid = cipid
                                        no-lock no-error.
                      if available xxcip_mstr then 
                      do:
                      assign cipdesc = xxcip_mstr.xxcip_cipdesc.
                      disp cipdesc  with frame cip .
                      end.
                      else
                      do:
                        /* CIPID NOT exist */
                       {us/bbi/pxmsg.i &MSGNUM = 9001 &ERRORLEVEL = 3}
                       
                       if c-application-mode <> "API" then do:
                          next-prompt cipid with frame cip.
                          undo, retry cipid-loop.
                       end.
                      end.
                                  
               
                end.
                
       end. /* do on error undo, retry: */
       hide frame cip.
  end. /* IF FRAME-FIELD = "YN" THEN DO: */
  
end.  /* ON ENTRY, GO ANYWHERE DO:  */


{us/bbi/gprun.i ""icunis.p""}